home *** CD-ROM | disk | FTP | other *** search
/ The Netter Presenter: Ur…ion in Overactive Bladder / The Netter Presenter: Urinary System - Structure & Function in Overactive Bladder.iso / mac / UrinarySystem.app / Contents / Main.dxr / Internal_17_create list Dialog.ls < prev    next >
Encoding:
Text File  |  2005-01-18  |  2.7 KB  |  91 lines

  1. global gCreateListDialog, glPFListNames, gNewList
  2.  
  3. on setupCreateListDialog
  4.   gNewList = new(xtra("MUI"))
  5.   if objectp(gNewList) then
  6.     CreateListDialogWinPropList = GetWindowPropList(gNewList)
  7.     CreateListDialogWinPropList.name = "Name The New List:"
  8.     CreateListDialogWinPropList.callback = "CreateListDialogCallBack"
  9.     CreateListDialogWinPropList.mode = #pixel
  10.     CreateListDialogWinPropList.closeBox = 1
  11.     CreateListDialogWinPropList.modal = 1
  12.     CreateListDialogWinPropList.xPosition = -1
  13.     CreateListDialogWinPropList.yPosition = -1
  14.     CreateListDialogWinPropList.width = 180
  15.     CreateListDialogWinPropList.height = 80
  16.     myWindowItemList = []
  17.     tempItemProps = GetItemPropList(gNewList)
  18.     tempItemProps.type = #WindowBegin
  19.     append(myWindowItemList, duplicate(tempItemProps))
  20.     tempItemProps = GetItemPropList(gNewList)
  21.     tempItemProps.type = #editText
  22.     tempItemProps.value = EMPTY
  23.     tempItemProps.locH = 8
  24.     tempItemProps.locV = 10
  25.     tempItemProps.width = 150
  26.     tempItemProps.height = 60
  27.     setProp(tempItemProps, #attributes, [#textStyle: [#plain]])
  28.     append(myWindowItemList, duplicate(tempItemProps))
  29.     tempItemProps = GetItemPropList(gNewList)
  30.     tempItemProps.type = #defaultPushButton
  31.     tempItemProps.title = "OK"
  32.     tempItemProps.locH = 8
  33.     tempItemProps.locV = 40
  34.     tempItemProps.width = 70
  35.     tempItemProps.height = 20
  36.     append(myWindowItemList, duplicate(tempItemProps))
  37.     tempItemProps = GetItemPropList(gNewList)
  38.     tempItemProps.type = #pushButton
  39.     tempItemProps.title = "Cancel"
  40.     tempItemProps.locH = 100
  41.     tempItemProps.locV = 40
  42.     tempItemProps.width = 70
  43.     tempItemProps.height = 20
  44.     append(myWindowItemList, duplicate(tempItemProps))
  45.     tempItemProps = GetItemPropList(gNewList)
  46.     tempItemProps.type = #WindowEnd
  47.     append(myWindowItemList, duplicate(tempItemProps))
  48.     Initialize(gNewList, [#windowPropList: CreateListDialogWinPropList, #windowItemList: myWindowItemList])
  49.   else
  50.   end if
  51. end
  52.  
  53. on CreateListDialogCallBack event, eventData, itemPropList
  54.   if symbolp(event) then
  55.     case event of
  56.       #itemChanged:
  57.         editedText = itemPropList.value
  58.         glPFListNames = [editedText]
  59.       #itemClicked:
  60.         if itemPropList.title = "Cancel" then
  61.           glPFListNames = []
  62.           stopCreateListDialog()
  63.         end if
  64.         if itemPropList.title = "OK" then
  65.           stopCreateListDialog()
  66.         end if
  67.       #windowOpening:
  68.       #windowClosed:
  69.       #windowZoomed:
  70.       #windowResized:
  71.       #itemEnteringFocus:
  72.       #itemLosingFocus:
  73.     end case
  74.   end if
  75. end
  76.  
  77. on runCreateListDialog
  78.   global gNewList
  79.   if objectp(gNewList) then
  80.     Run(gNewList)
  81.   end if
  82. end
  83.  
  84. on stopCreateListDialog
  85.   global gNewList
  86.   if objectp(gNewList) then
  87.     stop(gNewList, 0)
  88.   end if
  89.   go(the frame)
  90. end
  91.